package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.infrastructure.entity.result.OperationV2ConfigOuterDb;
import com.novax.ex.activity.infrastructure.entity.result.OperationV2SubConfigOuterDb;
import com.novax.ex.activity.infrastructure.mapper.OperationV2ConfigMapper;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * @Description 活动落地页配置V2
 * @Author ChenXi
 * @Date 2023/04/18/10:08
 */

@Service
public class OperationV2ConfigService extends BaseService {

    @Resource
    private OperationV2ConfigMapper operationV2ConfigMapper;

    @Override
    protected BaseMapper getBaseMapper() {
        return operationV2ConfigMapper;
    }

    /**
     * @Description: 查询是否次自定义ID是否已存在
     * @Author: ChenXi
     * @Date:  2023/4/18 15:40
     * @param customId
     * @return: java.lang.Integer
     **/
    public Long findByCustomId(String customId) {
        return operationV2ConfigMapper.findByCustomId(customId);
    }

    /**
     * @param language
     * @param customId
     * @Description: 前台查询主活动配置与标题规则
     * @Author: ChenXi
     * @Date: 2024/4/25 18:39
     * @return: com.novax.ex.common.results.ReturnResult<java.util.List < com.novax.ex.activity.open.model.response.OperationV2ConfigOuterResponse>>
     **/
    public OperationV2ConfigOuterDb query(String language, String customId) {
        return operationV2ConfigMapper.query(language, customId);
    }

    /**
     * @Description: 前台查询子活动配置与标题规则
     * @Author: ChenXi
     * @Date:  2024/4/25 18:39
     * @param language
     * @return: com.novax.ex.common.results.ReturnResult<java.util.List<com.novax.ex.activity.open.model.response.OperationV2ConfigOuterResponse>>
     **/
    public List<OperationV2SubConfigOuterDb> openSubList(String language, Long operationId) {
        return  operationV2ConfigMapper.openSubList(language, operationId);
    }

}
